﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Store_Keeper/Store_Keeper.master" AutoEventWireup="true" CodeFile="SK_Supplier.aspx.cs" Inherits="Store_Keeper_SK_Supplier" %>

<%@ Register Assembly="DevExpress.Web.ASPxGridView.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dx" %>

<%@ Register assembly="DevExpress.Web.ASPxEditors.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxEditors" tagprefix="dx" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
    <dx:ASPxGridView ID="ASPxGridView1" runat="server" AutoGenerateColumns="False" 
        ClientIDMode="AutoID" CssFilePath="~/App_Themes/BlackGlass/{0}/styles.css" 
        CssPostfix="BlackGlass" DataSourceID="SqlDataSource1" KeyFieldName="Sup_ID" 
        Width="100%" onrowvalidating="ASPxGridView1_RowValidating1" 
        onstartrowediting="ASPxGridView1_StartRowEditing1">
        <Columns>
            <dx:GridViewCommandColumn VisibleIndex="0" FixedStyle="Left" Width="50px">
                <EditButton Visible="True">
                </EditButton>

                 <ClearFilterButton Visible="True">
                </ClearFilterButton>
                <CellStyle Font-Bold="True" Font-Names="Tahoma" Font-Size="Small" 
                    ForeColor="#000066">
                </CellStyle>
                </dx:GridViewCommandColumn>
                <dx:GridViewCommandColumn VisibleIndex="1" FixedStyle="Left" Width="50px">
                <NewButton Visible="True">
                </NewButton>
                    <CellStyle Font-Bold="True" Font-Names="Tahoma" Font-Size="Small" 
                        ForeColor="#000066">
                    </CellStyle>
                </dx:GridViewCommandColumn>
                
            <dx:GridViewDataTextColumn FieldName="Sup_ID"  VisibleIndex="2" 
                Caption="Supplier ID" >
                
                <EditFormSettings Visible="False" />
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn FieldName="Sup_Name" VisibleIndex="3" 
                Caption="Supplier Name">
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn FieldName="Sup_Add" VisibleIndex="4" 
                Caption="Address">
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn FieldName="Sup_Tel" VisibleIndex="5" 
                Caption="Phone No">
                <PropertiesTextEdit>
                    <MaskSettings Mask="(999) 0000000" />
                </PropertiesTextEdit>
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn FieldName="Sup_mob" VisibleIndex="6" 
                Caption="Mobile No">
                <PropertiesTextEdit>
                    <MaskSettings Mask="(999) 0000000" />
                </PropertiesTextEdit>
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn FieldName="Sup_fax" VisibleIndex="7" 
                Caption="Fax No">
                <PropertiesTextEdit>
                    <ValidationSettings>
                        <RegularExpression ErrorText="Fax number is not in correct format" 
                            ValidationExpression="(999) 0000000" />
                    </ValidationSettings>
                </PropertiesTextEdit>
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn FieldName="Sup_email" VisibleIndex="8" 
                Caption="E-mail">
                <PropertiesTextEdit>
                    <ValidationSettings ErrorText="">
                        <RegularExpression ErrorText="Please Enter Correct E-mail Address" 
                            ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" />
                    </ValidationSettings>
                </PropertiesTextEdit>
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn FieldName="Sup_web" VisibleIndex="10" 
                Caption="Credit Period">
                <PropertiesTextEdit>
                    <ValidationSettings>
                        <RegularExpression ErrorText="Please Enter Web Address" />
                    </ValidationSettings>
                </PropertiesTextEdit>
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn Caption="Contact Person" FieldName="Contact" 
                VisibleIndex="9">
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataComboBoxColumn Caption="Check Type" FieldName="Check_Type" 
                ShowInCustomizationForm="True" VisibleIndex="11">
                <PropertiesComboBox ValueType="System.String">
                    <Items>
                        <dx:ListEditItem Text="A/C Payee" Value="A/C Payee" Selected="True" />
                        <dx:ListEditItem Text="Open" Value="Open" />
                    </Items>
                </PropertiesComboBox>
            </dx:GridViewDataComboBoxColumn>
            <dx:GridViewDataTextColumn FieldName="Check_Person" VisibleIndex="12" 
                Caption="Check Person">
            </dx:GridViewDataTextColumn>
        </Columns>
        <SettingsBehavior ConfirmDelete="True" />
        <SettingsPager PageSize="25">
        </SettingsPager>
        <Settings ShowHorizontalScrollBar="True" />
        <Images SpriteCssFilePath="~/App_Themes/BlackGlass/{0}/sprite.css">
            <LoadingPanelOnStatusBar Url="~/App_Themes/BlackGlass/GridView/gvLoadingOnStatusBar.gif">
            </LoadingPanelOnStatusBar>
            <LoadingPanel Url="~/App_Themes/BlackGlass/GridView/Loading.gif">
            </LoadingPanel>
        </Images>
        <ImagesFilterControl>
            <LoadingPanel Url="~/App_Themes/BlackGlass/Editors/Loading.gif">
            </LoadingPanel>
        </ImagesFilterControl>
        <Styles CssFilePath="~/App_Themes/BlackGlass/{0}/styles.css" 
            CssPostfix="BlackGlass">
            <Header ImageSpacing="5px" SortingImageSpacing="5px">
            </Header>
        </Styles>
        <StylesEditors>
            <CalendarHeader Spacing="1px">
            </CalendarHeader>
            <ProgressBar Height="25px">
            </ProgressBar>
        </StylesEditors>
    </dx:ASPxGridView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:BestlifeDBConnectionString %>" 
        DeleteCommand="DELETE FROM [Tbl_Supplier] WHERE [Sup_ID] = @Sup_ID" 
        InsertCommand="INSERT INTO [Tbl_Supplier] ([Sup_Name], [Sup_Tel], [Sup_mob], [Sup_fax], [Sup_email], [Sup_web], [Sup_Add], [Contact],[Check_Type],[Check_Person]) VALUES ( @Sup_Name, @Sup_Tel, @Sup_mob, @Sup_fax, @Sup_email, @Sup_web, @Sup_Add, @Contact,@Check_Type,@Check_Person)" 
        SelectCommand="SELECT Sup_Name, Sup_Tel, Sup_mob, Sup_fax, Sup_email, Sup_web, Sup_Add, Contact, Check_Person, Check_Type, Sup_ID FROM Tbl_Supplier" 
        
        
        UpdateCommand="UPDATE [Tbl_Supplier] SET [Sup_Name] = @Sup_Name, [Sup_Tel] = @Sup_Tel, [Sup_mob] = @Sup_mob, [Sup_fax] = @Sup_fax, [Sup_email] = @Sup_email, [Sup_web] = @Sup_web, [Sup_Add] = @Sup_Add, [Contact] = @Contact,[Check_Type]=@Check_Type,[Check_Person]=@Check_Person WHERE [Sup_ID] = @Sup_ID">
        <DeleteParameters>
            <asp:Parameter Name="Sup_ID" Type="String" />
        </DeleteParameters>
        <InsertParameters>
             <asp:Parameter Name="Check_Type" Type="String" />
              <asp:Parameter Name="Check_Person" Type="String" />
            <asp:Parameter Name="Sup_Name" Type="String" />
            <asp:Parameter Name="Sup_Tel" Type="String" />
            <asp:Parameter Name="Sup_mob" Type="String" />
            <asp:Parameter Name="Sup_fax" Type="String" />
            <asp:Parameter Name="Sup_email" Type="String" />
            <asp:Parameter Name="Sup_web" Type="String" />
            <asp:Parameter Name="Sup_Add" Type="String" />
            <asp:Parameter Name="Contact" Type="String" />
        </InsertParameters>
        <UpdateParameters>
         <asp:Parameter Name="Check_Type" Type="String" />
              <asp:Parameter Name="Check_Person" Type="String" />
            <asp:Parameter Name="Sup_Name" Type="String" />
            <asp:Parameter Name="Sup_Tel" Type="String" />
            <asp:Parameter Name="Sup_mob" Type="String" />
            <asp:Parameter Name="Sup_fax" Type="String" />
            <asp:Parameter Name="Sup_email" Type="String" />
            <asp:Parameter Name="Sup_web" Type="String" />
            <asp:Parameter Name="Sup_Add" Type="String" />
            <asp:Parameter Name="Contact" Type="String" />
            <asp:Parameter Name="Sup_ID" Type="String" />
        </UpdateParameters>
    </asp:SqlDataSource>

    <asp:Label ID="Label2" runat="server" Text="Label" Visible="False"></asp:Label>

</asp:Content>

